const { UsersModel } = require("../models/UsersModel");
const MyError = require("../exception");
const { MYSQL_ERROR_CODE } = require("../exception/errorCode");
/**
 * @description 创建用户数据
 * @returns
 */
const createUser = async () => {
  try {
    await UsersModel.create({
      name: "hashan",
      phone: "18309917351",
      avatar: "https://img.yzcdn.cn/vant/cat.jpeg",
      age: 22,
      sex: "男",
      roles: "admin",
      agree: true,
    });
    return true;
  } catch (error) {
    throw new MyError("用户创建失败", MYSQL_ERROR_CODE);
  }
};

module.exports = {
  createUser,
};
